<?php
class Front_Form_Contact extends Jnd_Form
{

    protected $_modeContact = array();
    
    public function __construct( $decorateur = "Formulairejndpro", $options = null )
    {
        if (isset($options['modeContact'])) {
            $this->_modeContact = $options['modeContact'];
            unset($options['modeContact']);
        }
        parent::__construct($decorateur, $options);
        $this->setElementDecorators(array(
            "$decorateur"
        ), array(), false);
    }

    public function init()
    {
        $this->setName("contact");
        $this->setAction("/contact/index");
        $this->setMethod("post");
        $this->addAttribs(array(
            "class" => "cssform"
        ));
        
        
        $champ = new Zend_Form_Element_Select("modeContact");
        $champ->setLabel(__("Qui ?"));
        $champ->setMultiOptions($this->_modeContact);
        $champ->setRequired(true);
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Text("objet");
        $champ->setLabel(__("Objet"));
        $champ->setDescription(__("Merci d'indiquer l'objet de votre demande."));
        $champ->setRequired(true);
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Text("from");
        $champ->setLabel(__("De"));
        $champ->setDescription(__("Merci d'indiquer votre nom."));
        $champ->setRequired(true);
        $champs[] = $champ;

        $champ = new Zend_Form_Element_Text("email");
        $champ->setLabel(__("Email"));
        $champ->setDescription(__("Merci d'indiquer votre email afin que l'on puisse vous répondre."));
        $champ->setRequired(true);
        $champs[] = $champ;
        
        $champ = new Jnd_Form_Element_AdvancedTextarea("message");
        $champ->setLabel(__("Mon message"));
        $champ->setAttribs(array(
            "toolbar" => "OsmlSimple",
            "height" => "150",
            "width" => "500"
        ));
        $champs[] = $champ;
        
        $this->addElements($champs);
    }

}

